from typing import List

from metagpt.actions.action_node import ActionNode


DESIGN_REVIEW = ActionNode(
    key="Design review",
    expected_type=dict,
    instruction=(
        "Analyze the provided PRD (Product Requirement Document) and System Design document. "
        "For each requirement in the PRD, check if the System Design fulfills it and judge that does the System Design need refined. "
        "Return the design review in a JSON format"
        "containing `satisfied` (True/False, does the System Design need refined) and `suggestion` (a string providing improvement suggestions) "
    ),
    example={
        "Design review": {
            "satisfied": False,
            "suggestion": "System Design lack of ..."
        }
    }
)


TASK_REVIEW = ActionNode(
    key="Task review",
    expected_type=dict,
    instruction=(
        "Analyze the provided Task list and Dependencies"
        "Evaluate does the Task list and Dependencies suffice to complete the System Design and give some suggestions to imporve Task List and Dependencies"
        "Return the review in a JSON format"
        "containing `satisfied` (True/False, does the task list is sufficent for System Design) and `suggestion` (a string providing improvement suggestions) "
    ),
    example={
        "Task review": {
            "satisfied": False,
            "suggestion": "Task List or Dependencies lack of ..."
        }
    }
)

GLOBAL_CODE_REVIEW = ActionNode(
    key="Global Code Review",
    expected_type=dict,
    instruction=(
        "According to the Task list and System Design analyze the provided Code Files"
        "Evaluate does the code files complete the requirements of Task list and System Design"
        "Give some suggestions to ensure all requirements in Task list and System Design are satisfied"
        "Return the review in a JSON format"
        "containing `satisfied` (True/False, does the task list is sufficent for System Design) and `suggestion` (a string providing improvement suggestions) "
    ),
    example={
        "Global Code Review": {
            "satisfied": False,
            "suggestion": {
                "main.py": "Code should including ...",
                "ui.py": "Function must be called ..."
            }
        }
    }
    # example={
    #     "Global Code Review": {
    #         "satisfied": False,
    #         "suggestion": "Code should including  ..."
    #     }
    # }
)

